package com.kantboot.business.bp.service.impl;

import com.kantboot.business.bp.domain.entity.BusBpGradeAndSubject;
import com.kantboot.business.bp.repository.BusBpGradeAndSubjectRepository;
import com.kantboot.business.bp.service.IBusBpGradeAndSubjectService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusBpGradeAndSubjectServiceImpl implements IBusBpGradeAndSubjectService {

    @Resource
    private BusBpGradeAndSubjectRepository repository;

    /**
     * 根据年级ID查询年级和学科
     * @param gradeId 年级ID
     * @return 年级和学科
     */
    @Override
    public List<BusBpGradeAndSubject> getByGradeId(Long gradeId) {
        return repository.findByGradeId(gradeId);
    }

    /**
     * 根据学科ID查询年级和学科
     * @param subjectId 学科ID
     * @return 年级和学科
     */
    @Override
    public List<BusBpGradeAndSubject> getBySubjectId(Long subjectId) {
        return repository.findBySubjectId(subjectId);
    }
}
